unit uTeams.local;

interface

uses uDebug.common;

type
  //================================ TEAMS
  TTeamItem = class( TObject )
  public
    TeamID    : integer;
    Name      : string;
    EngineID  : integer;
    ChassisID : integer;
    Points    : integer;
  end;
  TTeamList = class( TObject )
  public
    Items : array of TTeamItem;
    Count : integer;

    constructor Create;
    destructor Destroy; override;

    procedure Add(nTeamID:integer;nName:string;nEngineID,nChassisID:integer);
    procedure Clear;
  end;

implementation

  //================================ TEAMS
constructor TTeamList.Create;
begin
  inherited Create;

  Count := 0;
  SetLength( Items, Count );
end;
destructor TTeamList.Destroy;
begin
  Count := 0;
  SetLength( Items, Count );

  inherited Destroy;
end;
procedure TTeamList.Add(nTeamID:integer;nName:string;nEngineID,nChassisID:integer);
begin
  DevConsole.Msg(ES_DEBUG, 'Adding Team '+nName);

  Inc( Count );
  SetLength(Items, Count);

  Items[ Count-1 ] := TTeamItem.Create();

  with Items[ Count-1 ] do
  begin
    TeamID    := nTeamID;
    Name      := nName;
    EngineID  := nEngineID;
    ChassisID := nChassisID;
  end;
end;
procedure TTeamList.Clear;
begin
  Count := 0;
  SetLength( Items, Count );
end;

end.
